﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace MP3Ganizer.Common.BaseObject
{
    public class BaseModuleViewModel: INotifyPropertyChanged
    {
        private bool _isLoading = true;

        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public bool IsLoading
        {
            get { return _isLoading; }
            protected set {
                _isLoading = value;
                OnPropertyChanged("IsLoading");
            }
        }

        public void PropertiesChanged(string[] properties)
        {
            foreach (var property in properties)
                OnPropertyChanged(property);

        }
    }
}
